package com.ethan.lotmaster.mq;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class MqConfig {

    @Bean("queue")
    Queue queue(){
        System.out.println("---MqConfig");
        return QueueBuilder.durable("queue_lot_data").build();
    }
    @Bean("exchange")
    Exchange exchange(){
        return ExchangeBuilder.topicExchange("exchange_lot").build();
    }
    @Bean
    Binding bingding(Exchange exchange,Queue queue){
        return BindingBuilder.bind(queue).to(exchange).with("lot.#").noargs();
    }

}
